{% extends 'GlpmrQuizzBundle:Layout:layout.html.twig' %}

{% block body %}
    <div class="row">
        <h1>Liste des Quizzs</h1>
    </div>
    <br />
    <div class="row">
        <table class="striped bordered" id="list">
            <thead class="blue-grey darken-4">
                <tr>
                    <th data-field="titre" rowspan="2">Titre</th>
                    <th data-field="description" rowspan="2">Description</th>
                    <th data-field="promotion" rowspan="2">Promotion</th>
                    <th data-field="actif" rowspan="2">Actif ?</th>
                    <th data-field="action" colspan="2">Actions</th>

                </tr>
                <tr>
                    <th data-field="edit">Edit</th>
                    <th data-field="delete">Delete</th>
                </tr>
            </thead>
            <tbody>                
                {% for quizz in listQuizz %}
                    <tr>
                        <td>{{ quizz.titre }}</td>
                        <td>{{ quizz.description }}</td>
                        <td>{{ quizz.promotion.libelle }}</td>
                        <td>{% if quizz.etat == false %} D&eacute;sactiv&eacute; {% else %} Activ&eacute; {% endif %}</td>
                        <td class="center">
                            <a href="{{ path('glpmr_quizz_modifier', {'id': quizz.id} ) }}">
                                <button class="margin1 btn btn-floating waves-effect waves-light teal"><i class="mdi-content-create"></i></button>
                            </a>
                        </td>
                        <td class="center">
                            <a href="#confirmSuppr" class="modal-trigger" id="{{ quizz.id }}" data-type="quizz">
                                <button class="margin1 btn btn-floating waves-effect waves-light red darken-1"><i class="mdi-content-clear"></i></button>
                            </a>
                        </td>
                    </tr>

                {% endfor %}
                </div>

            <!-- Modal(Dialog) Structure -->
            <div id="confirmSuppr" class="modal">
                <h4>Confirmer</h4>
                <p>
                    &Ecirc;tes-vous s&ucirc;r de vouloir supprimer ce quizz ?
                </p>
                <a href="" class="suppr waves-effect btn-flat green">oui!</a>
                <a href="#" class="waves-effect btn-flat red modal-close">Non</a>
            </div>

        {% endblock %}
